using System;

namespace DecisionMaking.BusinessLogic
{
	
	public class DuplicateEmailException : Exception
	{
		public DuplicateEmailException(string email, Exception cause) : base(null, cause)
		{
			base.Data.Add("email", email);
		}
	}
	
	public class DuplicateEnvironmentNameException : Exception
	{
		public DuplicateEnvironmentNameException(string name, Exception cause) : base(null, cause)
		{
			base.Data.Add("name", name);
		}
	}
	
	public class DuplicateCueAttributeNameException : Exception
	{
		public DuplicateCueAttributeNameException(string name, Exception cause) : base(null, cause) 
		{
			base.Data.Add("name", name);
		}
	}	
	
	public class DuplicateCueNameException : Exception
	{
		public DuplicateCueNameException(string name, Exception cause) : base(null, cause) 
		{
			base.Data.Add("name", name);
		}
	}	
	
	public class DuplicateCandidateNameException : Exception
	{
		public DuplicateCandidateNameException(string name, Exception cause) : base(null, cause) 
		{
			base.Data.Add("name", name);
		}
	}
	
	public class AccountNotFoundException : Exception
	{
		public AccountNotFoundException(string email) : base(string.Format("Account with email %s was not found", email)) 
		{
			base.Data.Add("email", email);
		}		
	}
	
	public class AccessDeniedException : Exception
	{
		public AccessDeniedException(int accountId, Type type, Object objectId) 
			: base(string.Format("Account with id %s doesn't have access to %s with id %s", accountId, type, objectId)) 
		{
			base.Data.Add("accountId", accountId);
			base.Data.Add("type", type);
			base.Data.Add("objectId", objectId);
		}	
	}
	
	public class EntityNotFoundException : Exception
	{
		public EntityNotFoundException(Type type, Object id, Exception cause) : base(string.Format("%s with id %s was not found", type, id), cause) 
		{
			base.Data.Add("type", type);
			base.Data.Add("id", id);
		}		
	}	
}
